package com.cmcc.zysoft.sellmanager.model;
// Generated 2013-2-28 14:16:39 by Hibernate Tools 3.2.2.GA


import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * Role generated by hbm2java
 */
@Entity
@Table(name="tb_c_role")
public class Role  implements java.io.Serializable {


	 private static final long serialVersionUID = 5216237378899367533L;
	 private String roleId;
     private Company company;
     private String roleName;
     private String roleCode;
     private String description;
     private String status;
     private Integer displayOrder;
     private Set<UserRole> userRoles = new HashSet<UserRole>(0);
     private Set<RoleMenu> roleMenus = new HashSet<RoleMenu>(0);

    public Role() {
    }

	
    public Role(String roleId) {
        this.roleId = roleId;
    }
    public Role(String roleId, Company company, String roleName, String roleCode, String description, String status, Integer displayOrder, Set<UserRole> userRoles, Set<RoleMenu> roleMenus) {
       this.roleId = roleId;
       this.company = company;
       this.roleName = roleName;
       this.roleCode = roleCode;
       this.description = description;
       this.status = status;
       this.displayOrder = displayOrder;
       this.userRoles = userRoles;
       this.roleMenus = roleMenus;
    }
   
    @GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
    @Column(name="role_id", unique=true, nullable=false, length=32)
    public String getRoleId() {
        return this.roleId;
    }
    
    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="company_id")
    public Company getCompany() {
        return this.company;
    }
    
    public void setCompany(Company company) {
        this.company = company;
    }
    
    @Column(name="role_name", length=64)
    public String getRoleName() {
        return this.roleName;
    }
    
    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }
    
    @Column(name="role_code", length=32)
    public String getRoleCode() {
        return this.roleCode;
    }
    
    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    }
    
    @Column(name="description", length=256)
    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    @Column(name="status", length=1)
    public String getStatus() {
        return this.status;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
    
    @Column(name="display_order")
    public Integer getDisplayOrder() {
        return this.displayOrder;
    }
    
    public void setDisplayOrder(Integer displayOrder) {
        this.displayOrder = displayOrder;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    public Set<UserRole> getUserRoles() {
        return this.userRoles;
    }
    
    public void setUserRoles(Set<UserRole> userRoles) {
        this.userRoles = userRoles;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    public Set<RoleMenu> getRoleMenus() {
        return this.roleMenus;
    }
    
    public void setRoleMenus(Set<RoleMenu> roleMenus) {
        this.roleMenus = roleMenus;
    }




}


